FROM centos:7
MAINTAINER hp
#VOLUME /tmp
ADD jdk-8u181-linux-x64.tar.gz / 
ADD ./target/mg-gateway-app*.jar  /usr/local/src/app.jar
ENV JAVA_HOME=/jdk1.8.0_181
ENV PATH=$JAVA_HOME/bin:$PATH
ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /usr/local/src
ENV JAVA_OPTS="\
-server \
-Xms256m \
-Xmx512m \
-XX:MaxMetaspaceSize=128m \
-XX:CompressedClassSpaceSize=16m \
-Xss512k \
-Xmn128m \
-XX:InitialCodeCacheSize=8m \
-XX:ReservedCodeCacheSize=16m \
-XX:MaxDirectMemorySize=32m"
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=test   -jar /usr/local/src/app.jar
EXPOSE 4003
